<?php

namespace app\api\logic;

use \app\common\model\Swiper as SwiperModel;

class Swiper
{
    /**
     * getList
     * @return array
     */
    public function getList(): array
    {
        $where = ['status' => ['=', 1]];

        //输出字段
        $field = 'id,img_url,target_url';
        $list = app(SwiperModel::class)->field($field)->where($where)->limit(10)->select();

        //返回
        return $list ? $list->toArray() : [];
    }
}